package views.menu.tents;


import java.awt.Cursor;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.ImageIcon;

import models.tent.BasicSpeedTent;
import models.tent.Tent;

import util.ImageCursor;

@SuppressWarnings("serial")
public class BasicDefenseTentButton extends ElementTentMenu{
	
	private final TentsMenu tm;
	private ImageIcon image;
	private ImageCursor ic = new ImageCursor();
	
	public BasicDefenseTentButton(ImageIcon imageBasicTent, TentsMenu tmIn) {
		super(imageBasicTent);
		image = imageBasicTent;
		this.tm = tmIn;
		
		this.addMouseListener(new MouseListener() {
			
			@Override
			public void mouseReleased(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void mousePressed(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void mouseExited(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void mouseEntered(MouseEvent e) {
				// TODO Auto-generated method stub
				
			}
			
			@Override
			public void mouseClicked(MouseEvent e) {
				Tent basicSpeedTent = new BasicSpeedTent();
				
				tm.gp.setFocusable(true);
				tm.gp.requestFocusInWindow();
				tm.gp.tentPicked = true;
				tm.gp.tent = basicSpeedTent;
				
				Cursor c = ic.changeCursor(image);
				tm.gp.setCursor(c);
				
			}
		});
		
	}
}

